package com.personal.model.system;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import com.personal.model.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@ApiModel(description = "用户")
@TableName("sys_user")
@AllArgsConstructor
@NoArgsConstructor
public class SysUser extends BaseEntity {

	private static final long serialVersionUID = 1L;
	@TableId(type = IdType.AUTO)
	private String id;

	@ApiModelProperty(value = "用户名")
	@TableField("username")
	@Excel(name ="用户名", width = 15)
	private String username;

	@ApiModelProperty(value = "密码")
	@TableField("password")
	@Excel(name ="密码", width = 15)
	private String password;

	@ApiModelProperty(value = "姓名")
	@TableField("name")
	@Excel(name ="姓名", width = 15)
	private String name;

	@ApiModelProperty(value = "手机")
	@TableField("phone")
	@Excel(name ="手机", width = 15)
	private String phone;

	@ApiModelProperty(value = "头像地址")
	@TableField("head_url")
	@Excel(name ="头像地址", width = 15)
	private String headUrl;

	@ApiModelProperty(value = "部门id")
	@TableField("dept_id")
	@Excel(name ="部门id", width = 15)
	private Long deptId;

	@ApiModelProperty(value = "岗位id")
	@TableField("post_id")
	@Excel(name ="岗位id", width = 15)
	private Long postId;

	@ApiModelProperty(value = "描述")
	@TableField("description")
	@Excel(name ="描述", width = 15)
	private String description;

	@ApiModelProperty(value = "状态（1：正常 0：停用）")
	@TableField("status")
	@Excel(name ="状态", replace = {"正常_1","停用_0"}, width = 15)
	private Integer status;

	@Excel(name ="登陆IP", width = 15)
	private String ipAddress;

	@Excel(name ="岗位名称", width = 15)
	@TableField(exist = false)
	private String postName;

	@Excel(name ="部门名称", width = 15)
	@TableField(exist = false)
	private String deptName;

	@ExcelIgnore
	@TableField(exist = false)
	private Long roleId;
	@ExcelIgnore
	@TableField(exist = false)
	private List<SysRole> roleList;

}

